// toString() 保护
!function () {
  const MyGetOwnPropertySymbols = Object.getOwnPropertySymbols;

  Object.getOwnPropertySymbols = function getOwnPropertySymbols() {
    const result = MyGetOwnPropertySymbols.apply(this, arguments);
    for (let i = 0; i < result.length; i++) {
      if (result[i].toString().indexOf("myToString") != -1) return [];
    }
    return result;
  };

  const $toString = Function.toString;
  //为什么这里要随机，因为如果说不随机，那么就是固定检测特征，如果说目标代码检测了，你就G
  const myFunction_toString_symbol = Symbol(
    "myToString(".concat("", ")_", Math.random() + "").toString(36)
  );
  const myToString = function () {
    return (
      (typeof this === "function" && this[myFunction_toString_symbol]) ||
      $toString.call(this)
    );
  };
  function set_native(func, key, value) {
    Object.defineProperty(func, key, {
      enumerable: false,
      configurable: true,
      writable: true,
      value: value,
    });
  }

  //先删除所有函数的toString方法
  delete Function.prototype.toString;
  //在重定义一个所有函数公用的toString方法
  set_native(Function.prototype, "toString", myToString);
  set_native(
    Function.prototype.toString,
    myFunction_toString_symbol,
    "function toString() { [native code] }"
  );
  set_native(
    Object.getOwnPropertySymbols,
    myFunction_toString_symbol,
    `function getOwnPropertySymbols() { [native code] }`
  );
  globalThis.func_set_native = (func) => {
    set_native(
      func,
      myFunction_toString_symbol,
      `function ${func.name || ""}() { [native code] }`
    );
  };
  globalThis.func_set_native_Div = (func, name) => {
    set_native(
      func,
      myFunction_toString_symbol,
      `function ${name || ""}() { [native code] }`
    );
  };
}.bind(this)();

// Object.prototype.toString.call(obj) 保护
function obj_toString(obj, name) {
  Object.defineProperty(obj, Symbol.toStringTag, {
    value: name,
  });
}

function myProxy(obj, name) {
  return new Proxy(obj, {
    get(target, propKey, receiver) {
      //拦截对象属性的读取，比如proxy.foo和proxy['foo']。
      let temp = Reflect.get(target, propKey, receiver);
      console.log(`${name} -> get ${propKey.toString()} return -> ${temp}`);
      if (typeof temp == "object") {
        temp = myProxy(temp, name + " => " + propKey);
      }
      return temp;
    },
    set(target, propKey, value, receiver) {
      //拦截对象属性的设置，比如proxy.foo = v或proxy['foo'] = v，返回一个布尔值。
      const temp = Reflect.set(target, propKey, value, receiver);
      console.log(`${name} -> set ${propKey.toString()} value -> ${value}`);
      return temp;
    },
    has(target, propKey) {
      //拦截propKey in proxy的操作，返回一个布尔值。
      const temp = Reflect.has(target, propKey);
      console.log(`${name} -> has ${propKey.toString()}`);
      return temp;
    },
    deleteProperty(target, propKey) {
      //拦截delete proxy[propKey]的操作，返回一个布尔值。
      const temp = Reflect.deleteProperty(target, propKey);
      console.log(`${name} -> deleteProperty ${propKey.toString()}`);
      return temp;
    },
    getOwnPropertyDescriptor(target, propKey) {
      //拦截Object.getOwnPropertyDescriptor(proxy, propKey)，返回属性的描述对象。
      const temp = Reflect.getOwnPropertyDescriptor(target, propKey);
      return temp;
    },
    defineProperty(target, propKey, propDesc) {
      //拦截Object.defineProperty(proxy, propKey, propDesc）、Object.defineProperties(proxy, propDescs)，返回一个布尔值。
      const temp = Reflect.defineProperty(target, propKey, propDesc);
      return temp;
    },
    preventExtensions(target) {
      //拦截Object.preventExtensions(proxy)，返回一个布尔值。
      const temp = Reflect.preventExtensions(target);
      return temp;
    },
    getPrototypeOf(target) {
      //拦截Object.getPrototypeOf(proxy)，返回一个对象。
      const temp = Reflect.getPrototypeOf(target);
      return temp;
    },
    isExtensible(target) {
      //拦截Object.isExtensible(proxy)，返回一个布尔值。
      const temp = Reflect.isExtensible(target);
      return temp;
    },
    setPrototypeOf(target, proto) {
      //拦截Object.setPrototypeOf(proxy, proto)，返回一个布尔值。如果目标对象是函数，那么还有两种额外操作可以拦截。
      const temp = Reflect.setPrototypeOf(target, proto);
      return temp;
    },
    apply(target, object, args) {
      //拦截 Proxy 实例作为函数调用的操作，比如proxy(...args)、proxy.call(object, ...args)、proxy.apply(...)。
      const temp = Reflect.apply(target, object, args);
      return temp;
    },
    construct(target, args) {
      //拦截 Proxy 实例作为构造函数调用的操作，比如new proxy(...args)。
      const temp = Reflect.construct(target, args);
      return temp;
    },
  });
}

window = globalThis;
delete process;  // 检测点
self = window; 

window.document = {
  cookie:
    "SECKEY_ABVK=QvJWAuBRNGmhlBy61WvcbGX8s5EHcV1aVWRGBsKt34Gq7RXKa15RGlbwa4fJIetXqqxV0hAel+XNWkr7FWECUg%3D%3D; BMAP_SECKEY=QvJWAuBRNGmhlBy61WvcbGX8s5EHcV1aVWRGBsKt34FQf0x52OOhnspdZywE_qyolcnbHLAaoO4gwvRabqcXpUkXwwdAF9OBqw4MBiPR0OUPnvzVbB8Mo_4C3Iz-oNss0nPBgQ4rewvt6fhn2WBz4TSlC4AxOCC0DwcMASc_EQz7AsGvYulZlQ_aUKYtcSTEN1qmDBwnKcNLdiGfd3InskZYPP8kX2VYh82Q2MpffQg; _RGUID=fd19050f-f550-4d38-a046-89c5efc93ddc; _RSG=uq4Kr_G1PqFStJolNSY61A; _RDG=289259b0da0195271d303a6972f62ef3fb; UBT_VID=1715423709091.79c1I7IykDwB; GUID=09031024315566228427; FlightIntl=Search=[%22WUH|%E6%AD%A6%E6%B1%89(WUH)|477|WUH|480%22%2C%22HUZ|%E6%83%A0%E5%B7%9E(HUZ)|299|HUZ|480%22%2C%222024-05-30%22]; IBU_TRANCE_LOG_P=2396685228; MKT_CKID=1717658602171.ngxe0.20er; ibulanguage=CN; ibulocale=zh_cn; cookiePricesDisplayed=CNY; login_type=0; login_uid=71E0FB22E21C584F88D35F7F5D2CA34A; DUID=u=71E0FB22E21C584F88D35F7F5D2CA34A&v=0; IsNonUser=F; AHeadUserInfo=VipGrade=5&VipGradeName=%B0%D7%D2%F8%B9%F3%B1%F6&UserName=&NoReadMessageCount=0; intl_ht1=h4=34_82298877,34_25405715; hotel=82298877; Hm_lvt_4a51227696a44e11b0c61f6105dc4ee4=1722508323,1722588136; HMACCOUNT=B1F27D770401397B; Hm_lpvt_4a51227696a44e11b0c61f6105dc4ee4=1722588241; _bfa=1.1715423709091.79c1I7IykDwB.1.1722588146055.1722588241185.9.3.102002; _jzqco=%7C%7C%7C%7C1722825824421%7C1.1323400543.1717658602173.1722588152200.1722588241386.1722588152200.1722588241386.0.0.0.46.46; _RF1=240e%3A36f%3Ad50%3A7fe0%3Ac2b4%3A7dff%3Afea1%3A646f; CTC_SCI=7D479CA826271D18E30C7FFD11C2911F1FCB66659CE3D77BFDC2DA475265499A1EDABE3225B3A4A4E8EB8DD071D019710BA1E1BBB9A4414800DEC91EEC2FE2ECD398B7132DAB14D1231EEDB526365EAF9A5TZRQ2JA==; CTC_CAL=519BDFFC77A534C56050A244FCA2F41C48B93CEC1C8E650F6AAE503C590C70F3F62TZRQ2KQ==; librauuid=",
};
window.location = {
  ancestorOrigins: {},
  href: "https://hotels.ctrip.com/hotels/list?countryId=1&city=34&provinceId=0&checkin=2024/12/30&checkout=2024/12/31&optionId=34&optionType=City&directSearch=0&display=%E6%98%86%E6%98%8E&crn=1&adult=1&children=0&searchBoxArg=t&travelPurpose=0&ctm_ref=ix_sb_dl&domestic=1&",
  origin: "https://hotels.ctrip.com",
  protocol: "https:",
  host: "hotels.ctrip.com",
  hostname: "hotels.ctrip.com",
  port: "",
  pathname: "/hotels/list",
  search:
    "?countryId=1&city=34&provinceId=0&checkin=2024/12/30&checkout=2024/12/31&optionId=34&optionType=City&directSearch=0&display=%E6%98%86%E6%98%8E&crn=1&adult=1&children=0&searchBoxArg=t&travelPurpose=0&ctm_ref=ix_sb_dl&domestic=1&",
  hash: "",
};
window.navigator = {};
window.external = {};
window.screen = {};

// ======
Navigator = function Navigator() {};
func_set_native(Navigator);
Location = function Location() {};
func_set_native(Location);
Window = function Window() {};
func_set_native(Window);
HTMLDocument = function HTMLDocument() {};
func_set_native(HTMLDocument);
Document = function Document() {};
func_set_native(Document);
Node = function Node() {};
func_set_native(Node);
EventTarget = function EventTarget() {};
func_set_native(EventTarget);
External = function External() {
  console.log("External hello", arguments);
};
func_set_native(External);
Screen = function Screen() {};
func_set_native(Screen);
HTMLImageElement = function HTMLImageElement() {};
func_set_native(HTMLImageElement);
Image = function Image() {
  console.log("Image arguments: ", arguments);
  var img = new HTMLImageElement();
  // img = myProxy(img, "img");
  return img;
};
Object.setPrototypeOf(Image.prototype, HTMLImageElement.prototype);

// =====document
Object.setPrototypeOf(document, HTMLDocument.prototype);
Object.setPrototypeOf(HTMLDocument.prototype, Document.prototype);
Object.setPrototypeOf(Document.prototype, Node.prototype);
Object.setPrototypeOf(Node.prototype, EventTarget.prototype);

// =====window
Object.setPrototypeOf(window, Window.prototype);
Object.setPrototypeOf(Window.prototype, EventTarget.prototype);
// =====navigator
Object.setPrototypeOf(navigator, Navigator.prototype);
// ====location
Object.setPrototypeOf(location, Location.prototype);
// ====external
Object.setPrototypeOf(external, External.prototype);
// ====screen
Object.setPrototypeOf(screen, Screen.prototype);

// ======补
HTMLHtmlElement = function HTMLHtmlElement(arguments) {
  this.getAttribute = function (val) {
    // selenium, webdriver, driver
    console.log("getAttribute获取了属性: ", val);
    return null;
  };
};
func_set_native(HTMLHtmlElement);

Object.defineProperty(Document.prototype, "documentElement", {
  enumerable: true,
  configurable: true,
  get: function () {
    return new HTMLHtmlElement();
  },
});
Object.defineProperty(
  Object.getOwnPropertyDescriptor(Document.prototype, "documentElement").get,
  "name",
  {
    value: "get documentElement",
    writable: false,
    enumerable: false,
    configurable: true,
  }
);
// 代理documentElement
// document.documentElement = myProxy(document.documentElement, "documentElement");

Element = function Element() {};
func_set_native(Element);
HTMLElement = function HTMLElement() {};
func_set_native(HTMLElement);
HTMLDivElement = function HTMLDivElement() {
  this.tagName = "DIV";
  this.style = {
    height: "",
  };
  this.offsetHeight = 0; // 对 height 和 offsetHeight 的处理
  // console.log("HTMLDivElement创建了: ", arguments);  // 不创建任何东西
  // this.style = myProxy(this.style, "style"); // 给style挂上代理
  this.remove = function () {
    console.log("remove了 DIV");
    this.offsetHeight = 0;
  };
};
func_set_native(HTMLDivElement);

Object.setPrototypeOf(Element.prototype, Node.prototype);
Object.setPrototypeOf(HTMLElement.prototype, Element.prototype);
Object.setPrototypeOf(HTMLDivElement.prototype, HTMLElement.prototype);

// a标签
HTMLAnchorElement = function HTMLAnchorElement() {
  this.tagName = "A";
};
func_set_native(HTMLAnchorElement);

// p标签
HTMLParagraphElement = function HTMLParagraphElement() {
  this.tagName = "P";
};
func_set_native(HTMLParagraphElement);

// h标签
HTMLHeadingElement = function HTMLHeadingElement() {
  this.tagName = "H1";
};
func_set_native(HTMLHeadingElement);

// span标签
HTMLSpanElement = function HTMLSpanElement() {
  this.tagName = "SPAN";
};
func_set_native(HTMLSpanElement);

// ul标签
HTMLUListElement = function HTMLUListElement() {
  this.tagName = "UL";
};
func_set_native(HTMLUListElement);

// li标签
HTMLLIElement = function HTMLLIElement() {
  this.tagName = "LI";
};
func_set_native(HTMLLIElement);

document.createElement = function createElement(arguments) {
  let clasName = arguments;
  console.log("createElement创建了:",arguments,"标签");
  // debugger;
  switch (clasName) {
    case "div":
      // console.log("这是一个div");
      var div = new HTMLDivElement();
      // div = myProxy(div, "div"); // 只要是对象，我们就需要挂上代理
      return div; //div;
    case "a":
      // console.log("这是一个a");
      var aa = new HTMLAnchorElement();
      // aa = myProxy(aa, "aa");
      return aa;
    case "p":
      // console.log("这是一个p");
      var pp = new HTMLParagraphElement();
      // pp = myProxy(pp, "pp");
      return pp;
    case "h1" || "h2" || "h3" || "h4":
      // console.log("这是一个h");
      var h1 = new HTMLHeadingElement();
      // h1 = myProxy(h1, "h1");
      return h1;
    case "span":
      // console.log("这是一个span");
      var span = new HTMLSpanElement();
      // span = myProxy(span, "span");
      return span;
    case "ul":
      // console.log("这是一个ul");
      var ul = new HTMLUListElement();
      // ul = myProxy(ul, "ul");
      return ul;
    case "li":
      // console.log("这是一个li");
      var li = new HTMLLIElement();
      // li = myProxy(li, "li");
      return li;
  }
  // return null;
};
func_set_native(document.createElement);
// document.createElement = myProxy(document.createElement, "createElement"); // 代理createElement

HTMLBodyElement = function HTMLBodyElement() {
  this.children = {
    0: "svg",
    1: "div#hp_header",
    2: "div#hp_container.left_is_mini",
    3: "input#page_id",
    4: "script",
    5: "script",
    6: "script",
    7: "script",
    8: "script",
    9: "script",
    10: "script",
    11: "script",
    12: "script",
    13: "script",
    14: "script",
    15: "div#popup-root",
    16: "script",
    17: "script",
    18: "script",
    length: 19, // document.body.children.length
  };
  obj_toString(this.children, "HTMLCollection");
  // this.children = myProxy(this.children, "children"); // 给children挂上代理
  this.appendChild = function (child){
    if (child.tagName=="DIV"){
        child.offsetHeight = 20;
        console.log("DIV标签offsetHeight设置为:", child.offsetHeight);
    }
  }
};
func_set_native(HTMLBodyElement);
document.body = new HTMLBodyElement();
obj_toString(document.body, "HTMLBodyElement");
// document.body = myProxy(document.body, "body"); // 给body挂上代理
Object.setPrototypeOf(HTMLBodyElement.prototype, HTMLElement.prototype);

Navigator.prototype.webdriver = false;
Navigator.prototype.platform = "Win32";
Navigator.prototype.appCodeName = "Mozilla";
Navigator.prototype.userAgent =
  "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36";

// (对象)Symbol.toStringTag 保护
obj_toString(window, "Window");
obj_toString(document, "HTMLDocument");
obj_toString(navigator, "Navigator");
obj_toString(location, "Location");
obj_toString(external, "External");
obj_toString(screen, "Screen");

// 代理对象
// window = myProxy(window, "window");
// self = myProxy(self, "self");
// document = myProxy(document, "document");
// location = myProxy(location, "location");
// navigator = myProxy(navigator, "navigator");
// external = myProxy(external, "external");
// screen = myProxy(screen, "screen");

// 冻结对象
Object.freeze(navigator);  // 检测点


// Object.keys
_keys = Object.keys;
Object.keys = function (obj) {
  // console.log("Object.keys ===> ", arguments);
  // debugger;
  if (obj === document) {
    return ["location", "_reactListeningc3zxzs8jb7p", "__sn"];
  }
  if (obj === HTMLDocument.prototype || obj === document.__proto__) {
    return [];
  }
  if (obj === Document.prototype || obj === document.__proto__.__proto__) {
    return [
      "implementation",
      "URL",
      "documentURI",
      "compatMode",
      "characterSet",
      "charset",
      "inputEncoding",
      "contentType",
      "doctype",
      "documentElement",
      "xmlEncoding",
      "xmlVersion",
      "xmlStandalone",
      "domain",
      "referrer",
      "cookie",
      "lastModified",
      "readyState",
      "title",
      "dir",
      "body",
      "head",
      "images",
      "embeds",
      "plugins",
      "links",
      "forms",
      "scripts",
      "currentScript",
      "defaultView",
      "designMode",
      "onreadystatechange",
      "anchors",
      "applets",
      "fgColor",
      "linkColor",
      "vlinkColor",
      "alinkColor",
      "bgColor",
      "all",
      "scrollingElement",
      "onpointerlockchange",
      "onpointerlockerror",
      "hidden",
      "visibilityState",
      "wasDiscarded",
      "prerendering",
      "featurePolicy",
      "webkitVisibilityState",
      "webkitHidden",
      "onbeforecopy",
      "onbeforecut",
      "onbeforepaste",
      "onfreeze",
      "onprerenderingchange",
      "onresume",
      "onsearch",
      "onvisibilitychange",
      "timeline",
      "fullscreenEnabled",
      "fullscreen",
      "onfullscreenchange",
      "onfullscreenerror",
      "webkitIsFullScreen",
      "webkitCurrentFullScreenElement",
      "webkitFullscreenEnabled",
      "webkitFullscreenElement",
      "onwebkitfullscreenchange",
      "onwebkitfullscreenerror",
      "rootElement",
      "pictureInPictureEnabled",
      "onbeforexrselect",
      "onabort",
      "onbeforeinput",
      "onbeforematch",
      "onbeforetoggle",
      "onblur",
      "oncancel",
      "oncanplay",
      "oncanplaythrough",
      "onchange",
      "onclick",
      "onclose",
      "oncontentvisibilityautostatechange",
      "oncontextlost",
      "oncontextmenu",
      "oncontextrestored",
      "oncuechange",
      "ondblclick",
      "ondrag",
      "ondragend",
      "ondragenter",
      "ondragleave",
      "ondragover",
      "ondragstart",
      "ondrop",
      "ondurationchange",
      "onemptied",
      "onended",
      "onerror",
      "onfocus",
      "onformdata",
      "oninput",
      "oninvalid",
      "onkeydown",
      "onkeypress",
      "onkeyup",
      "onload",
      "onloadeddata",
      "onloadedmetadata",
      "onloadstart",
      "onmousedown",
      "onmouseenter",
      "onmouseleave",
      "onmousemove",
      "onmouseout",
      "onmouseover",
      "onmouseup",
      "onmousewheel",
      "onpause",
      "onplay",
      "onplaying",
      "onprogress",
      "onratechange",
      "onreset",
      "onresize",
      "onscroll",
      "onsecuritypolicyviolation",
      "onseeked",
      "onseeking",
      "onselect",
      "onslotchange",
      "onstalled",
      "onsubmit",
      "onsuspend",
      "ontimeupdate",
      "ontoggle",
      "onvolumechange",
      "onwaiting",
      "onwebkitanimationend",
      "onwebkitanimationiteration",
      "onwebkitanimationstart",
      "onwebkittransitionend",
      "onwheel",
      "onauxclick",
      "ongotpointercapture",
      "onlostpointercapture",
      "onpointerdown",
      "onpointermove",
      "onpointerrawupdate",
      "onpointerup",
      "onpointercancel",
      "onpointerover",
      "onpointerout",
      "onpointerenter",
      "onpointerleave",
      "onselectstart",
      "onselectionchange",
      "onanimationend",
      "onanimationiteration",
      "onanimationstart",
      "ontransitionrun",
      "ontransitionstart",
      "ontransitionend",
      "ontransitioncancel",
      "oncopy",
      "oncut",
      "onpaste",
      "children",
      "firstElementChild",
      "lastElementChild",
      "childElementCount",
      "activeElement",
      "styleSheets",
      "pointerLockElement",
      "fullscreenElement",
      "adoptedStyleSheets",
      "pictureInPictureElement",
      "fonts",
      "adoptNode",
      "append",
      "captureEvents",
      "caretRangeFromPoint",
      "clear",
      "close",
      "createAttribute",
      "createAttributeNS",
      "createCDATASection",
      "createComment",
      "createDocumentFragment",
      "createElement",
      "createElementNS",
      "createEvent",
      "createExpression",
      "createNSResolver",
      "createNodeIterator",
      "createProcessingInstruction",
      "createRange",
      "createTextNode",
      "createTreeWalker",
      "elementFromPoint",
      "elementsFromPoint",
      "evaluate",
      "execCommand",
      "exitFullscreen",
      "exitPictureInPicture",
      "exitPointerLock",
      "getAnimations",
      "getElementById",
      "getElementsByClassName",
      "getElementsByName",
      "getElementsByTagName",
      "getElementsByTagNameNS",
      "getSelection",
      "hasFocus",
      "hasStorageAccess",
      "hasUnpartitionedCookieAccess",
      "importNode",
      "open",
      "prepend",
      "queryCommandEnabled",
      "queryCommandIndeterm",
      "queryCommandState",
      "queryCommandSupported",
      "queryCommandValue",
      "querySelector",
      "querySelectorAll",
      "releaseEvents",
      "replaceChildren",
      "requestStorageAccess",
      "requestStorageAccessFor",
      "startViewTransition",
      "webkitCancelFullScreen",
      "webkitExitFullscreen",
      "write",
      "writeln",
      "fragmentDirective",
      "browsingTopics",
      "hasPrivateToken",
      "hasRedemptionRecord",
      "onscrollend",
      "onscrollsnapchange",
      "onscrollsnapchanging",
      "caretPositionFromPoint",
    ];
  }
  if (
    obj === Node.prototype ||
    obj === document.__proto__.__proto__.__proto__
  ) {
    return [
      "nodeType",
      "nodeName",
      "baseURI",
      "isConnected",
      "ownerDocument",
      "parentNode",
      "parentElement",
      "childNodes",
      "firstChild",
      "lastChild",
      "previousSibling",
      "nextSibling",
      "nodeValue",
      "textContent",
      "ELEMENT_NODE",
      "ATTRIBUTE_NODE",
      "TEXT_NODE",
      "CDATA_SECTION_NODE",
      "ENTITY_REFERENCE_NODE",
      "ENTITY_NODE",
      "PROCESSING_INSTRUCTION_NODE",
      "COMMENT_NODE",
      "DOCUMENT_NODE",
      "DOCUMENT_TYPE_NODE",
      "DOCUMENT_FRAGMENT_NODE",
      "NOTATION_NODE",
      "DOCUMENT_POSITION_DISCONNECTED",
      "DOCUMENT_POSITION_PRECEDING",
      "DOCUMENT_POSITION_FOLLOWING",
      "DOCUMENT_POSITION_CONTAINS",
      "DOCUMENT_POSITION_CONTAINED_BY",
      "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC",
      "appendChild",
      "cloneNode",
      "compareDocumentPosition",
      "contains",
      "getRootNode",
      "hasChildNodes",
      "insertBefore",
      "isDefaultNamespace",
      "isEqualNode",
      "isSameNode",
      "lookupNamespaceURI",
      "lookupPrefix",
      "normalize",
      "removeChild",
      "replaceChild",
    ];
  }
  if (
    obj === EventTarget.prototype ||
    obj === document.__proto__.__proto__.__proto__.__proto__
  ) {
    return ["addEventListener", "dispatchEvent", "removeEventListener"];
  }
  if (obj === HTMLImageElement.prototype) {
    return [
      "alt",
      "src",
      "srcset",
      "sizes",
      "crossOrigin",
      "useMap",
      "isMap",
      "width",
      "height",
      "naturalWidth",
      "naturalHeight",
      "complete",
      "currentSrc",
      "referrerPolicy",
      "decoding",
      "fetchPriority",
      "loading",
      "name",
      "lowsrc",
      "align",
      "hspace",
      "vspace",
      "longDesc",
      "border",
      "x",
      "y",
      "decode",
      "attributionSrc",
      "sharedStorageWritable",
    ];
  }
  return _keys.apply(this, arguments);
};
func_set_native(Object.keys);  // 检测点

// Object.getOwnPropertyNames
_getOwnPropertyNames = Object.getOwnPropertyNames;
Object.getOwnPropertyNames = function (obj) {
  // console.log("Object.getOwnPropertyNames ==> ", obj);
  if (obj == navigator) {
    return [];
  }
  // debugger;
  return _getOwnPropertyNames.apply(this, arguments);
};
func_set_native(Object.getOwnPropertyNames);  // 检测点

// Object.getOwnPropertyDescriptor
_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
Object.getOwnPropertyDescriptor = function (target, property) {
  // console.log("Object.getOwnPropertyDescriptor ==> ", arguments);
  // debugger;
  if (target == navigator) {
    console.log("getOwnPropertyDescriptor navigator ==>", property);
    return undefined;
  }
  return _getOwnPropertyDescriptor.apply(this, arguments);
};
func_set_native(Object.getOwnPropertyDescriptor);  // 检测点

// vm node 检测
RegExp = new Proxy(RegExp, {
  construct(target, argArray) {
    if (argArray[0] && argArray[0].indexOf("vm") !== -1) {
      // debugger;
      return new target(
        ...["bootstrapNodeJSCoretryModuleLoadevalmachinerunInContext", "g"]
      );
    }
    return new target(...argArray);
  },
});  // 检测点
